package com.item.news.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
import redis.clients.jedis.Jedis;

/**
 * @ClassName JedisConfig
 * @Description TODO
 * @Author WangDong
 * @Date 2019/2/14 13:30
 * @Version 1.0
 **/


public class JedisConfig {

    private Jedis jedis;

    private static String url="localhost";

    //懒人加载，线程安全
    public JedisConfig(){
        System.out.println(url);
        jedis=new Jedis(url);
    }

    public Jedis getJedis(){
        return this.jedis;
    }

}
